<?php

namespace app\admin\model;

use app\common\model\TimeModel;

class Sales extends TimeModel
{

    protected $name = "sales";

    public function getTypeList()
    {
        return ['0'=>'定制','1'=>'现有',];
    }

    public function getProjectStatusList()
    {
        return ['0'=>'首次对接','1'=>'二次跟踪','2'=>'多次跟踪','3'=>'已交易',];
    }

    public function getStatusList()
    {
        return ['0'=>'对接中','1'=>'已失败',];
    }

    public function images()
    {
        return $this->hasManyThrough(SystemUploadfile::class, SalesDetail::class,'sales_id','id','id','uploadfile_id');
    }

    public function salesDetail(){
        return $this->hasMany(SalesDetail::class,'sales_id','id');
    }

}